/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ViewUtama.java
 *
 * Created on Dec 1, 2010, 1:36:57 PM
 */
package view;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.Paint;
import java.awt.Toolkit;

/**
 *
 * @author fauzi
 */
public class ViewUtama extends javax.swing.JFrame {

    Suplier viewSuplier;
    Barang barang;
    BarangMasuk barangMasuk;
    BarangKeluar barangKeluar;
    IjinPengeluaran ijinPengeluaran;
    Pegawai pegawai;
    PelaporanBarang pelaporanBarang;
    private Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    private Paint paint;
    private Font Font2D;
    public static FormBarang formBarang;
    public static String kodeBarang;
    public static FormPegawai formPegawai;
    public static String nip;
    public static FormIjinPengeluaran formIjinPengeluaran;
    public static String noIjinPengeluaran;
    public static FormSuplier formSuplier;
    public static String kodeSuplier;
    public static String jabatan = "";

    /** Creates new form ViewUtama */
    public ViewUtama() {
        initComponents();
        setBounds(0, 0, screen.width, screen.height);
        jButton_PelaporanBarang.setVisible(false);
        jButton_Barang.setVisible(false);
        jButton_BarangKeluar.setVisible(false);
        jButton_BarangMasuk.setVisible(false);
        jButton_IjinPengeluaran.setVisible(false);
        jButton_Pegawai.setVisible(false);
        jButton_Suplier.setVisible(false);
    }

    public void setJabatan(String jabatan) {
        ViewUtama.jabatan = jabatan;
        if (jabatan.equals("kepala gudang")) {
            jButton_PelaporanBarang.setVisible(true);
            jButton_Barang.setVisible(true);
            jButton_BarangKeluar.setVisible(true);
            jButton_BarangMasuk.setVisible(true);
            jButton_IjinPengeluaran.setVisible(true);
            jButton_Pegawai.setVisible(true);
            jButton_Suplier.setVisible(true);
        } else if (jabatan.equals("supervisor")) {
            jButton_IjinPengeluaran.setVisible(true);
            jButton_PelaporanBarang.setVisible(true);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton_Suplier = new javax.swing.JButton();
        jButton_Barang = new javax.swing.JButton();
        jButton_BarangMasuk = new javax.swing.JButton();
        jButton_BarangKeluar = new javax.swing.JButton();
        jButton_IjinPengeluaran = new javax.swing.JButton();
        jButton_Pegawai = new javax.swing.JButton();
        jButton_PelaporanBarang = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton_Suplier.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_Suplier.setText("Suplier");
        jButton_Suplier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SuplierActionPerformed(evt);
            }
        });

        jButton_Barang.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_Barang.setText("Barang");
        jButton_Barang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_BarangActionPerformed(evt);
            }
        });

        jButton_BarangMasuk.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_BarangMasuk.setText("Barang Masuk");
        jButton_BarangMasuk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_BarangMasukActionPerformed(evt);
            }
        });

        jButton_BarangKeluar.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_BarangKeluar.setText("Barang Keluar");
        jButton_BarangKeluar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_BarangKeluarActionPerformed(evt);
            }
        });

        jButton_IjinPengeluaran.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_IjinPengeluaran.setText("Ijin Pengeluaran");
        jButton_IjinPengeluaran.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_IjinPengeluaranActionPerformed(evt);
            }
        });

        jButton_Pegawai.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_Pegawai.setText("Pegawai\n");
        jButton_Pegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_PegawaiActionPerformed(evt);
            }
        });

        jButton_PelaporanBarang.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton_PelaporanBarang.setText("Pelaporan Barang");
        jButton_PelaporanBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_PelaporanBarangActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton_IjinPengeluaran, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_Barang)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_Suplier, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_BarangKeluar, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_BarangMasuk, javax.swing.GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_PelaporanBarang, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_Pegawai, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
                .addGap(18, 18, 18))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_IjinPengeluaran, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_Barang, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
                    .addComponent(jButton_Suplier, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_BarangKeluar, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_BarangMasuk, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_PelaporanBarang, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_Pegawai, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(370, 370, 370))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_SuplierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SuplierActionPerformed
        formSuplier = new FormSuplier();
        formSuplier.setVisible(true);
}//GEN-LAST:event_jButton_SuplierActionPerformed

    private void jButton_BarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_BarangActionPerformed
        formBarang = new FormBarang();
        formBarang.setVisible(true);
}//GEN-LAST:event_jButton_BarangActionPerformed

    private void jButton_BarangMasukActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_BarangMasukActionPerformed
        FormBarangMasuk fbm = new FormBarangMasuk();
        fbm.setVisible(true);
    }//GEN-LAST:event_jButton_BarangMasukActionPerformed

    private void jButton_BarangKeluarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_BarangKeluarActionPerformed
        FormBarangKeluar fbk = new FormBarangKeluar();
        fbk.setVisible(true);
    }//GEN-LAST:event_jButton_BarangKeluarActionPerformed

    private void jButton_IjinPengeluaranActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_IjinPengeluaranActionPerformed
        formIjinPengeluaran = new FormIjinPengeluaran();
        formIjinPengeluaran.setVisible(true);        
}//GEN-LAST:event_jButton_IjinPengeluaranActionPerformed

    private void jButton_PegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_PegawaiActionPerformed
        formPegawai = new FormPegawai();
        formPegawai.setVisible(true);
}//GEN-LAST:event_jButton_PegawaiActionPerformed

    private void jButton_PelaporanBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_PelaporanBarangActionPerformed
        FormPelaporanBarang fpb = new FormPelaporanBarang();
        fpb.setVisible(true);
    }//GEN-LAST:event_jButton_PelaporanBarangActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                ViewUtama v = new ViewUtama();
                v.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_Barang;
    private javax.swing.JButton jButton_BarangKeluar;
    private javax.swing.JButton jButton_BarangMasuk;
    private javax.swing.JButton jButton_IjinPengeluaran;
    private javax.swing.JButton jButton_Pegawai;
    private javax.swing.JButton jButton_PelaporanBarang;
    private javax.swing.JButton jButton_Suplier;
    // End of variables declaration//GEN-END:variables
}
